export default {
    state: {
        iscontrol: false, //控制菜单是否展开
        tabList: [
            {
                path: "/",
                name: "home",
                label: "首页",
                icon: "s-home",
                url: "Home/Home"
            }
        ]
    },
    mutations: {
        controlmenu(state) {
            state.iscontrol = !state.iscontrol
        },
        selectMenu(state, val) {
            console.log(val);
            if (val.name !== 'home') {
                const index = state.tabList.findIndex(item => item.name === val.name)
                if (index === -1) {
                    state.tabList.push(val)
                }
            }
        },
        closeTag(state,item) {
            // console.log(item,'item');
            const index = state.tabList.findIndex(val => val.name === item.name)
            state.tabList.splice(index,1)
        }
    },
    actions: {
    },
    modules: {
    }
}
